<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    
</body>
<script>


    function Parent(m){
        this.msg = m;
    }
    Parent.prototype.show = function(){
        console.log(this.msg);
    }

    function Child(m){}

    Child.prototype = new Parent("world");
    Child.prototype.show = function(){
        console.log("123123")
    }

    const p = new Parent("hello");
    console.log(p);
    p.show();

    const c = new Child();
    console.log(c);
    c.show();

    // 继承之前：实例c的__proto__指向了Child.prototype
    // 继承之后：实例c的__proto__指向了Parent的实例，Parent的实例的__proto__指向了Parnet.prototype

    // 利用原型链的规则，查找到要使用的方法或属性

    
</script>
</html>